package lp.xian.materials.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lp.xian.materials.mapper.WarehouseStockMapper;
import lp.xian.materials.domain.WarehouseStock;
import lp.xian.materials.service.IWarehouseStockService;

/**
 * 库存管理Service业务层处理
 *
 * @author ruoyi
 * @date 2023-08-17
 */
@Service
public class WarehouseStockServiceImpl implements IWarehouseStockService
{
    @Autowired
    private WarehouseStockMapper warehouseStockMapper;

    /**
     * 查询库存管理
     *
     * @param warehouseStockId 库存管理主键
     * @return 库存管理
     */
    @Override
    public WarehouseStock selectWarehouseStockByWarehouseStockId(Integer warehouseStockId)
    {
        return warehouseStockMapper.selectWarehouseStockByWarehouseStockId(warehouseStockId);
    }

    /**
     * 查询库存管理列表
     *
     * @param warehouseStock 库存管理
     * @return 库存管理
     */
    @Override
    public List<WarehouseStock> selectWarehouseStockList(WarehouseStock warehouseStock)
    {
        return warehouseStockMapper.selectWarehouseStockList(warehouseStock);
    }

    /**
     * 新增库存管理
     *
     * @param warehouseStock 库存管理
     * @return 结果
     */
    @Override
    public int insertWarehouseStock(WarehouseStock warehouseStock)
    {
        warehouseStock.setCreateTime(DateUtils.getNowDate());
        return warehouseStockMapper.insertWarehouseStock(warehouseStock);
    }

    /**
     * 修改库存管理
     *
     * @param warehouseStock 库存管理
     * @return 结果
     */
    @Override
    public int updateWarehouseStock(WarehouseStock warehouseStock)
    {
        warehouseStock.setUpdateTime(DateUtils.getNowDate());
        return warehouseStockMapper.updateWarehouseStock(warehouseStock);
    }

    /**
     * 批量删除库存管理
     *
     * @param warehouseStockIds 需要删除的库存管理主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseStockByWarehouseStockIds(Integer[] warehouseStockIds)
    {
        return warehouseStockMapper.deleteWarehouseStockByWarehouseStockIds(warehouseStockIds);
    }

    /**
     * 删除库存管理信息
     *
     * @param warehouseStockId 库存管理主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseStockByWarehouseStockId(Integer warehouseStockId)
    {
        return warehouseStockMapper.deleteWarehouseStockByWarehouseStockId(warehouseStockId);
    }
}
